package com.zr.controller.base;

import com.zr.service.base.BaseCityService;
import com.zr.utils.AjaxResult;
import com.zr.vo.base.BaseCity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * 城市数据处理
 */
@RestController
@RequestMapping("/base/city")
public class BaseCityController {

    @Resource
    private BaseCityService baseCityService;

    /**
     * 查询所有城市用于级联菜单
     * @author huangguilong
     * @return
     */
    @RequestMapping("/listAll")
    public AjaxResult listAll(){
        List<BaseCity> baseCityList = baseCityService.listAll();
        return AjaxResult.success(200, "查询成功", baseCityList);
    }

    /**
     * @author wanglu
     * 查询所有二级城市
     * @return
     */
    @RequestMapping("/list")
    public AjaxResult list(){
        List<BaseCity> baseCityList = baseCityService.list();
        return AjaxResult.success(200, "查询成功", baseCityList);
    }

}
